#include<iostream>
#include<stdio.h>
#include<string.h>

using namespace std;

int main()
{
    FILE* fp=fopen("test.txt","w");
    if(fp==nullptr)
    {
        perror("fopen error");
    }

    const char f[100] ={"hello xjp\n"};
    fwrite(f,strlen(f),1,fp);

    fclose(fp);

    return 0;
}